package com.ftg.learn.service;

import com.ftg.learn.mapper.XinwenMapper;
import com.ftg.learn.pojo.Xinwen;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class XinwenService {
    @Autowired
    XinwenMapper xinwenMapper;

    //查询方法showall
    public List<Xinwen> showall(int page, int limit){
        int begin = (page - 1)*limit;
        return xinwenMapper.showall(begin,limit);
    }
    //查一方法findone
    public List<Xinwen> findone(String xinwen_id, String xinwen_bt){
        return xinwenMapper.findone(xinwen_id,xinwen_bt);
    }
    //共多少条信息方法getcount
    public int getcount(){
        return xinwenMapper.getcount();
    }
    //添加方法add
    public int add(Xinwen xinwen){
        return xinwenMapper.add(xinwen);
    }
    //删除方法delete
    public int delete(String xinwen_id){
        return xinwenMapper.delete(xinwen_id);
    }
    //修改
    public int update(Xinwen xinwen){
        return xinwenMapper.update(xinwen);
    }

}
